package com.dotstone.chipism.adapter;

import com.dotstone.chipism.fragment.BBSFragment;
import com.dotstone.chipism.fragment.MainFragment;
import com.dotstone.chipism.fragment.StoreFragment;
import com.dotstone.chipism.fragment.UserFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/*************************************************************************
 * 公 司： 深圳市高金科技有限公司 作 者： 深圳市高金科技有限公司 文件名称：FragmentAdapter.java 内容摘要：主页加载我的设备
 * 在线商城和用户中心三个fragment的适配器 日 期： 2016-11-28
 ************************************************************************/
public class FragmentAdapter extends FragmentPagerAdapter {
	public final static int COUNT = 4;

	public FragmentAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int id) {
		switch (id) {
		case 0:
//			Log.i("wmy", "获取mainFragment");
			MainFragment mainFragment = new MainFragment();
			return mainFragment;
		case 1:
//			Log.i("wmy", "获取bbsFragment");
			BBSFragment bbsFragment = new BBSFragment();
			return bbsFragment;
		case 2:
//			Log.i("wmy", "获取storeFragment");
			StoreFragment storeFragment = new StoreFragment();
			return storeFragment;
		case 3:
//			Log.i("wmy", "获取userFragment");
			UserFragment userFragment = new UserFragment();
			return userFragment;
		}
		return null;
	}

	@Override
	public int getCount() {
		return COUNT;
	}

}
